<!DOCTYPE html>
<html lang="en">
  	<head>
	    <meta charset="utf-8">
	    <title>学生管理系统</title>
	    <meta name="viewport" content="width=device-width, initial-scale=1.0">
	    <meta name="description" content="">
	    <meta name="author" content="">

	    <!-- Bootstrap core CSS -->
	    <link href="/admin/bootstrap/css/bootstrap.min.css" rel="stylesheet">
		
		<!-- Font Awesome -->
		<link href="/admin/css/font-awesome.min.css" rel="stylesheet">

		<!-- ionicons -->
		<link href="/admin/css/ionicons.min.css" rel="stylesheet">
		
		<!-- Simplify -->
		<link href="/admin/css/simplify.min.css" rel="stylesheet">
	
  	</head>

  	<body class="overflow-hidden light-background">
		<div class="wrapper no-navigation preload">
			<div class="sign-in-wrapper">
				<div class="sign-in-inner">
					<div class="login-brand text-center">
						<i class="fa fa-database m-right-xs"></i> 学生 <strong class="text-skin">管理系统</strong>
					</div>

					<form id="loginForm">
						<div class="form-group m-bottom-md">
							<input type="email" name="email" class="form-control" placeholder="请输入邮箱">
						</div>
						<div class="form-group">
							<input type="password" name="pwd" class="form-control" placeholder="请输入密码">
						</div>
						<div class="form-group">
							<input type="text" class="form-control pull-left" style="width: 250px;" placeholder="请输入验证码" name="code">
							<img src="/admin/main/imgCode" alt="" class="pull-right" onclick="this.src='/admin/main/imgCode?m='+Math.random()">
							<div class="clearfix"></div>
						</div>

						<div class="form-group">
							<div class="custom-checkbox">
								<input type="checkbox" id="chkRemember" name="remeber">
								<label for="chkRemember"></label>
							</div>
							记住我
						</div>

						<div class="m-top-md p-top-sm">
							<a href="javascript:;" class="btn btn-success block" id="login">立即登录</a>
						</div>

						<div class="m-top-md p-top-sm">
							<!-- <div class="font-12 text-center m-bottom-xs">
								<a href="#" class="font-12">Forgot password ?</a>
							</div> -->
							<div class="font-12 text-center m-bottom-xs">我没有账号?</div>
							<a href="/admin/main/register" class="btn btn-default block">注册一个账号</a>
						</div>
					</form>
				</div><!-- ./sign-in-inner -->
			</div><!-- ./sign-in-wrapper -->
		</div><!-- /wrapper -->

		<a href="" id="scroll-to-top" class="hidden-print"><i class="icon-chevron-up"></i></a>

	    <!-- Le javascript
	    ================================================== -->
	    <!-- Placed at the end of the document so the pages load faster -->
		
		<!-- Jquery -->
		<!-- <script src="/admin/js/jquery-1.11.1.min.js"></script> -->
		<script src="https://cdn.bootcss.com/jquery/1.8.1/jquery.js"></script>
		<script src="/admin/layer/layer.js"></script>
		
		<!-- Bootstrap -->
	    <script src="/admin/bootstrap/js/bootstrap.min.js"></script>
		
		<!-- Slimscroll -->
		<script src='/admin/js/jquery.slimscroll.min.js'></script>
		
		<!-- Popup Overlay -->
		<script src='/admin/js/jquery.popupoverlay.min.js'></script>

		<!-- Modernizr -->
		<script src='/admin/js/modernizr.min.js'></script>
		
		<!-- Simplify -->
		<script src="/admin/js/simplify/simplify.js"></script>

		<script src="/admin/js/common.js"></script>
	
		<script>
		$('#login').on('click',function(){
			var formData=new FormData($('#loginForm')[0])
			if(!checkEmail(formData.get('email'))){
				// alert('请正确输入邮箱')
				layer.alert('请正确输入邮箱', {
				  icon: 2
				})
				return false
			}
			if(checkRequired(formData.get('pwd'))){
				// alert('请输入密码')
				layer.alert('请输入密码', {
				  icon: 2
				})
				return false
			}
			$.ajax({
				url:'/admin/main/loginData',
				type:'post',
				data:formData,
				contentType: false,
        		processData: false,
        		dataType: 'json',
        		success:function(res){
        			// alert(res.msg)
        			layer.alert(res.msg, {
					  icon: 0
					})
        			if(res.error==0){
        				location.href='/admin/main/main_index'
        			}
        		}
			})
		})
		</script>
	
  	</body>
</html>